package com.cloud.flowable.entity.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.cloud.flowable.entity.dto.WfCommentDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.flowable.engine.task.Comment;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@Schema(name = "流程任务视图VO", description = "流程管理")
public class WfTaskVo implements Serializable {

    @Schema(description = "任务编号")
    @Excel(name ="任务编号")
    private String taskId;

    @Schema(description = "任务名称")
    @Excel(name ="任务名称")
    private String taskName;

    @Schema(description = "任务Key")
    private String taskDefKey;

    @Schema(description = "任务执行人Id")
    private Long assigneeId;

    @Schema(description = "部门名称")
    @Excel(name ="部门名称")
    @Deprecated
    private String deptName;

    @Schema(description = "发起人部门名称")
    @Deprecated
    private String startDeptName;

    @Schema(description = "任务执行人名称")
    @Excel(name ="任务执行人名称")
    private String assigneeName;

    @Schema(description = "流程发起人Id")
    private Long startUserId;

    @Schema(description = "流程发起人名称")
    @Excel(name ="流程发起人名称")
    private String startUserName;

    @Schema(description = "流程类型")
    @Excel(name ="流程类型")
    private String category;

    @Schema(description = "流程变量信息")
    private Object procVars;

    @Schema(description = "局部变量信息")
    private Object taskLocalVars;

    @Schema(description = "流程部署编号")
    private String deployId;

    @Schema(description = "流程ID")
    private String procDefId;

    @Schema(description = "流程key")
    private String procDefKey;

    @Schema(description = "流程定义名称")
    @Excel(name ="流程定义名称")
    private String procDefName;

    @Schema(description = "流程定义内置使用版本")
    @Excel(name ="流程使用版本")
    private int procDefVersion;

    @Schema(description = "流程实例ID")
    private String procInsId;

    @Schema(description = "历史流程实例ID")
    private String hisProcInsId;

    @Schema(description = "任务耗时")
    private String duration;

    @Schema(description = "任务意见")
    @Excel(name ="任务意见")
    private WfCommentDto comment;

    @Schema(description = "任务意见")
    private List<Comment> commentList;

    @Schema(description = "候选执行人")
    @Excel(name ="候选执行人")
    private String candidate;

    @Schema(description = "任务创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name ="任务创建时间", exportFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Schema(description = "任务完成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name ="任务完成时间", exportFormat = "yyyy-MM-dd HH:mm:ss")
    private Date finishTime;

    @Schema(description = "流程状态")
    @Excel(name ="流程状态")
    private String processStatus;

}
